<div class="header">
    <nav class="navbar navbar-inverse navbar-static-top navbar-default">
        <div class="container">
            <div class="navbar-header" id="navbar-header"> 
                <a href="/" class="navbar-brand"><b>OpenResty</b> China</a>
            </div> 

            <span>
              <ul class="nav navbar-nav" id="main-nav-menu">
                  <li id="nav-index"><a href="/index">全部</a></li>
                  <li id="nav-share" class=""><a href="/share">分享</a></li>
                  <li id="nav-ask" class=""><a href="/ask">问答</a></li>
                  <li id="nav-about" class=""><a href="/about">关于</a></li>
              </ul>
            </span>
 
            <ul class="nav user-bar navbar-nav navbar-right">
                {%
                    if locals and locals.login and locals.login == true then
                %}
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{{ locals.username }} 
                    <span class="caret"></span>
                    </a>
 
                    <button class="navbar-toggle" type="button" data-toggle="dropdown" role="button" aria-expanded="false"> 
                        <span class="sr-only">Toggle</span>
                        <i class="fa fa-reorder"></i>
                    </button>
                    <ul class="dropdown-menu" role="menu">
                        <li class=""><a href="/user/{{locals.username}}/index">我的主页</a></li>
                        <li class=""><div class="divider"></div></li>
                        <li class=""><a href="/settings">个人设置</a></li>
                        <li class=""><a href="/topic/new">发布新文章</a></li>
                        <li class=""><div class="divider"></div></li>
                        <li class=""><a rel="nofollow" href="/auth/logout">退出</a></li>
                    </ul>
                </li>

                {% else %}
                    <li><a href="/auth/sign_up">注册</a></li>
                    <li><a href="/auth/login">登录</a></li>
                {% end %}
            </ul>

            
            <ul class="nav navbar-nav navbar-right">
                <!-- <li class="nav-search hidden-xs">
                    <form class="navbar-form form-search active" action="/search" method="GET">
                        <div class="form-group">
                            <input class="form-control" name="q" type="text" value="" placeholder="搜索本站内容">
                        </div> <i class="fa btn-search fa-search"></i>
                    </form>
                </li> -->
                <li class="notification-count" id="notification-area"> 
                    <a href="/notification/" class="" title="通知">
                        <i class="fa fa-bell"></i>
                        <span class="count"></span>
                    </a>
                </li>
            </ul>
            
        </div>
    </nav>
</div>